xen/arm: introduce allocate_static_memory
authorPenny Zheng <penny.zheng@arm.com>
Fri, 10 Sep 2021 02:52:15 +0000 (02:52 +0000)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Mon, 13 Sep 2021 21:15:04 +0000 (14:15 -0700)
commit487975df53b5298316b594550c79934d646701bd
tree013ee36a4237842e945ee8ef3bf2579f1d1190e6
parentc7fe462c0d274ffa30c9448c0a80affa075d789d
xen/arm: introduce allocate_static_memory

This commit introduces a new function allocate_static_memory to allocate
static memory as guest RAM for domains on Static Allocation.

It uses acquire_domstatic_pages to acquire pre-configured static memory
for the domain, and uses guest_physmap_add_pages to set up the P2M table.
These pre-defined static memory banks shall be mapped to the usual guest
memory addresses (GUEST_RAM0_BASE, GUEST_RAM1_BASE) defined by
xen/include/public/arch-arm.h.

In order to deal with the trouble of count-to-order conversion when page number
is not in a power-of-two, this commit exports p2m_insert_mapping and introduce
a new function guest_physmap_add_pages to cope with adding guest RAM p2m
mapping with nr_pages.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c
xen/arch/arm/p2m.c
xen/include/asm-arm/p2m.h